﻿using Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IRepository
{
   public  interface IOutboundManagementRepository
    {

        Task<List<WMSOrderSalesOrder3>> GetAllWMSOutboundAsync(
string sales_order_no = null,
string document_status = null,
string customer_name = null,
DateTime? sales_date = null,
string sales_person=null,
string sales_dept=null);




      Task<List<WMSOrderSalesOrder4>> GetOutboundById(string salesOrderNo);


        //根据仓库id查询库位
        Task<List<StorageLocationEntity2>> GetByWarehouseId(int warehouseId);

        //根据库位id查询库存
        Task<int> GetByLocationAndProduct(int locationId);



        // 1. 修改接口声明，增加货品编号参数
        Task<int> GetInventoryByTargetSql(int warehouseId, int locationId, string productCode);




        //出库管理的新增操作
        Task<int> AddOutboundOrderAsync(WMSKNZYDeliveryNote order, List<WMSKNZYOutboundDetails> details);



        /// <summary>
        /// 查询出库单列表（支持参数化筛选）
        /// </summary>
        /// <param name="outboundOrderNo">出库单号（模糊匹配，如传%CK2025%）</param>
        /// <param name="outboundType">出库类型（如“销售出库”）</param>
        /// <param name="outboundStatus">单据状态（如“2”）</param>
        /// <param name="warehouseName">仓库名称（如“长沙仓库二”）</param>
        /// <returns>出库单DTO集合</returns>
        Task<List<OutboundOrderDTO>> GetOutboundOrders(string outboundOrderNo = null, string outboundType = null, string outboundStatus = null, string warehouseName = null);




        /// <summary>
        /// 批量审核出库单（包含事务处理）
        /// </summary>
        /// <param name="dto">审核参数（出库单号、结果、意见）</param>
        Task AuditAsync(OutboundAuditDTO dto);




    }
}
